package com.itita.ww2.enums;

public enum AreaEnum {
	DEFAULT(0), // 默认区域(无效区域)
	WORLDMAP, // 世界地图区域
	CITY, // 城市内
	AL_BF, // 盟战战场内
	USER_BASE, // 玩家基地内
	;
	private int value;

	private AreaEnum() {
		this(Counter.nextValue);
	}

	private AreaEnum(int value) {
		this.value = value++;
		Counter.nextValue = value;
	}

	public int getValue() {
		return value;
	}

	public static AreaEnum valueOf(int value) {
		for (AreaEnum type : AreaEnum.values()) {
			if (type.getValue() == value) {
				return type;
			}
		}
		return DEFAULT;
	}

	private static class Counter {
		private static int nextValue = 0;
	}
}
